#pragma once

#include <QOpenGLWindow>
#include <QMatrix4x4>

class QOpenGLFunctions_3_3_Core;
class QOpenGLShaderProgram;
class QOpenGLVertexArrayObject;
class QOpenGLBuffer;
class Camera;


class MyGlWindow : public QOpenGLWindow
{
    Q_OBJECT

public:
    MyGlWindow();

protected:
    virtual void initializeGL();
    virtual void paintGL();
    virtual void resizeGL(int w, int h);
    virtual void keyPressEvent(QKeyEvent* ev);
    virtual void mouseMoveEvent(QMouseEvent *ev);
    virtual void wheelEvent(QWheelEvent *ev);

private slots:
  void teardownGL();

private:
    void printContextInformation();

    QOpenGLFunctions_3_3_Core*  MY_GL_FUNC;
    QOpenGLShaderProgram*       program;
    QOpenGLVertexArrayObject*   vao;
    QOpenGLBuffer*              vbo;
    QOpenGLBuffer*              ebo;

    int                         trans;
    Camera*                     camera;
    bool                        firstMouse;
    QPoint                      lastMousePos;
};
